<?php
declare (strict_types=1);

namespace app\admin\controller;

use app\common\facade\Builder;

class UserLevel extends Base
{
    //主键，默认为id
    protected string $pk = 'id';

    //主模型
    protected string $model = '\app\common\model\Level';

    public function index(): string
    {
        return Builder::Table()
            ->addColumn(['field' => 'id', 'sort' => true, 'title' => 'ID', 'width' => 80])
            ->addColumn(['field' => 'title', 'title' => '名称', 'modify' => '2,input'])
            ->addColumn(['field' => 'update_time', 'title' => '更新时间'])
            ->addColumn(['fixed' => 'right', 'align' => 'center', 'toolbar' => '#barDemo', 'title' => '操作', 'width' => 100])
            ->addRightButtons(['edit'])
            ->fetch();
    }
}